import test from './test.js'
import { getAccountInfoSync } from './base.js'

const currentEnv = getAccountInfoSync().miniProgram.envVersion
export const env = {
	develop: 'https://gateway-dev.yilife.cn/',
	trial: 'https://gateway.yilife.cn/',
	release: 'https://gateway.yilife.cn/',
}
const url = env[currentEnv]
export const baseUrl = () => {
	let nowUrl = currentEnv === 'release' ? url : test.$test
	if (getApp()) {
		getApp().globalData.uploadDomain = nowUrl
	}
	return nowUrl
}
